package com.ehualu.check.utils;

import org.apache.commons.codec.digest.DigestUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @Author: 吴敬超
 * @Date: 2021/3/17 17:32
 */
public class MD5until {

    public static void main(String[] args) {


        try {

            System.out.println(System.currentTimeMillis());
//            InputStream data= new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\scala-2.11.12.tgz"));

            System.out.println(DigestUtils.md5Hex(new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\scala-2.11.12.tgz"))));
            System.out.println(DigestUtils.md5Hex(new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\scala-2.11.12 - 副本.tgz"))));

//            System.out.println(DigestUtils.md5Hex("D:\\HDP2.6.5搭建手册\\scala-2.11.12.tgz"));
//            System.out.println(DigestUtils.sha256Hex(data));
//
//
//            System.out.println(DigestUtils.md5Hex(data));

//            System.out.println(DigestUtils.sha256(new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\scala-2.11.12.tgz"))));

//            DigestUtils.sha256Hex(new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\scala-2.11.12.tgz")));
            System.out.println(System.currentTimeMillis());
//            System.out.println(DigestUtils.sha256Hex(new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\CentOS-7-x86_64-Everything-1708.iso"))));
            System.out.println(DigestUtils.sha256Hex(new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\scala-2.11.12.tgz"))));
            System.out.println(DigestUtils.sha256Hex(new FileInputStream(new File("D:\\HDP2.6.5搭建手册\\scala-2.11.12 - 副本.tgz"))));

            System.out.println(System.currentTimeMillis());

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
